package com.jbit.dm_160.controller;

import com.jbit.dm_160.model.dto.ItemDTO;
import com.jbit.dm_160.model.vo.SearchVO;
import com.jbit.dm_160.service.ItemService;
import com.jbit.dm_160.utils.Page;
import com.jbit.dm_160.utils.ResponseEntity;
import com.jbit.dm_160.utils.ResponseUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/search/api")
public class SearchController {
    @Resource
    private ItemService itemService;
    @PostMapping("/p/list/queryItemList")
    public ResponseEntity<Page<ItemDTO>> queryItemList(@RequestBody SearchVO searchVO){
        return ResponseUtils.sendSuccess(itemService.getItemsBySearchInfo(searchVO));
    }
}
